#include <cassert>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <vector>
#include <chrono>

#include "Camera.h"

using namespace std;

int main() {
	auto start = std::chrono::steady_clock::now();

	int ret = Connect("config.json");
	if (ret != 0) {
		std::cout << "Failed: " << ret << std::endl;
		return 0;
	}
	auto end = std::chrono::steady_clock::now();
	auto dur = std::chrono::duration_cast<std::chrono::milliseconds>(end - start);

	cout << "Connected in " << dur.count() << "ms" << std::endl;

	start = std::chrono::steady_clock::now();
	ret = CapturePointCloud("pointcloud");
	if (ret != 0) {
		std::cout << "Failed: " << ret << std::endl;
		return 0;
	}
	end = std::chrono::steady_clock::now();
	dur = std::chrono::duration_cast<std::chrono::milliseconds>(end - start);
	cout << "Caputred in " << dur.count() << "ms" << std::endl;

	Close();
	return 0;
}
